#include  <Windows.h>
#include <commctrl.h>
#pragma comment(lib,"comctl32.lib")
#pragma comment(lib,"Imm32.lib")
#include <strsafe.h>


#include <vnnv/bas/vnnv_mapfile.h>
#include <vnnv/bas/vnnv_mem.h>
#include <vnnv/bas/vnnv_textfile_read.h>
#include <vnnv/unichar/vnnv_unicode_string.h>
#include <vnnv/unichar/vnnv_unicode_zi.h>
#include <vnnv/bas/vnnv_hfmtree.h>
#include <vnnv/bas/vnnv_path.h>

#include <vnnv/bas/vnnv_error.h>
#include <vnnv/bas/vnnv_textfile.h>



#include <HtmlHelp.h>
#pragma comment(lib,"HtmlHelp.lib")

#include "convertTextFile.h"

typedef struct{
	HWND htext1;
	HWND hedit;
	HWND hcheck;
	HWND hrich;
	HWND hlist;

	HFONT hfont;
	HFONT hfont_list;
	
	//HWND hbut_delete;
	//HWND hbut_modity;
	//HWND hbut_insertone;

	//HWND hbut_up;
	//HWND hbut_down;
	//HWND hbut_home;
	//HWND hbut_end;

}winmbedit,*pwinmbedit;

//for modity.c
void modity_setdata(wchar_t *psz_key, wchar_t *psz_data, unsigned long curitem, unsigned long olditem);
INT_PTR CALLBACK modity_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);

//for wndabout.c
INT_PTR CALLBACK about_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
//for import data
void import_setmode(int mode);
INT_PTR CALLBACK import_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);

//for wnd_convert_dmg.c
INT_PTR CALLBACK convert_dmg_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
void set_opend_dmgflag(char flag);
wchar_t *get_opend_mdgfilename();
char *get_opend_bid16();
char *get_opend_fekey();

//for wnd_convert_format.c
INT_PTR CALLBACK convert_format_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);

//for wnd_make_ciku.c
INT_PTR CALLBACK make_ciku_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);

//for wnd_make_mabiao.c
INT_PTR CALLBACK make_mabiao_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);

//for wnd_marge_mabiao.c
INT_PTR CALLBACK marge_mabiao_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);

//for radmb.c
unsigned char readmb_ismoditied();
unsigned long readmb_openfile(wchar_t *psz_filename);
void readmb_close();
unsigned long readmb_get_txtcount();
unsigned long readmb_getcount();
unsigned long readmb_save(unsigned char flag , void *param);
wchar_t *readmb_getsegment(unsigned long flag,unsigned long index);
unsigned long readmb_filter(wchar_t*pkey , unsigned long flag);
void readmb_sort_move_up(unsigned long pos_A, unsigned long pos_B);
void readmb_sort_move_down(unsigned long pos_A, unsigned long pos_B);
wchar_t *readmb_getsegment(unsigned long flag,unsigned long index);
unsigned long readmb_export(wchar_t* psz_filename);
unsigned long readmb_export_zi(wchar_t* psz_filename);

unsigned long readmb_sort_fromkey(unsigned long flag);
unsigned long readmb_sort_fromdata(unsigned long flag);
unsigned long readmb_sort_fromcipin(wchar_t *psz_file);
unsigned long readmb_sort_fromreaded();

unsigned long readmb_item_modity(unsigned long curitem, unsigned long olditem,wchar_t *pszkey, wchar_t *pszdata);
unsigned long readmb_item_remove(unsigned long curitem);
unsigned long readmb_item_insert(wchar_t *pskey, wchar_t *psdata);
unsigned long mabiaotongji_1(wchar_t *psz_filename);

unsigned long readmb_removesame();

//filter.c
BOOL mod_cvs_init(HMODULE hins);
unsigned char mod_cvs_modGetStringFilter(wchar_t * lpText);
BOOL mod_cvs_modMakeCSFFile(wchar_t *lpszFilename);
unsigned char * mod_cvs_modGetCVSTable();

#include <vnnv/duoduo/dmg/vnnv_duoduo_dmg_mbmake.h>